#ifndef USERDATA_H
#define USERDATA_H
#include <QJsonArray>
#include <QJsonObject>
#include <QString>
#include <QVector>
#include <memory>

struct SearchInfo
{
    SearchInfo() = default;
    SearchInfo(int uid, QString name, QString nick, QString desc, int sex, QString icon);
    int _uid;
    QString _name;
    QString _nick;
    QString _desc;
    int _sex;
    QString _icon;
};

struct AddFriendApply
{
    AddFriendApply(int from_uid, QString name, QString desc, QString icon, QString eamil, int sex);
    int _from_uid;
    QString _name;
    QString _desc;
    QString _icon;
    QString _email;
    int _sex;
};

struct ApplyInfo
{
    ApplyInfo() = default;
    ApplyInfo(int uid, QString name, QString desc, QString icon, QString email, int sex, int status);
    int uid;
    QString name;
    QString desc;
    QString icon;
    QString email;
    int sex;
    int status;
};

struct AuthInfo
{
    AuthInfo(int uid, QString name, QString remark, QString icon, QString desc, int sex);
    int uid;
    QString name;
    QString remark;
    QString icon;
    QString desc;
    int sex;
};

struct AuthRsp
{
    AuthRsp(int peer_uid,
            QString peer_name,
            QString peer_remark,
            QString peer_icon,
            QString peer_desc,
            int peer_sex);

    int uid;
    QString name;
    QString remark;
    QString icon;
    QString desc;
    int sex;
};

struct TextChatData;
struct FriendInfo
{
    int uid;
    QString name;
    QString remark;
    QString icon;
    int sex;
    QString desc;
    QString email;
    QString last_msg;
    QString last_msg_time;
    QVector<std::shared_ptr<TextChatData>> chat_msgs;
};

struct UserInfo
{
    int uid;
    QString token;
    QString name;
    QString email;
    QString icon;
    int sex;
    QString last_msg;
    std::vector<std::shared_ptr<TextChatData>> chat_msgs;
};

struct TextChatData
{
    TextChatData() = default;
    QString msg_id;
    QString msg_content;
    QString send_time;
    int from_uid;
    int to_uid;
};

#endif
